
<style scoped>
.avatar{
  font-size: 28px;
  color: #8c939d;
  width: 50px;
  height: 50px;
  text-align: center;
}
</style>




<template>
  <el-dialog v-model="show" title="报名审核" width="750" draggable>
    <div class="row-center" style="margin-top: 20px;user-select: none" >
      <div class="justify-center w-full d-column p-10" style="width: 310px">
        <!--姓名-->
        <el-form-item label="姓名" label-width="100">
          <el-input v-model="itemInfo.realName" maxlength="15" disabled />
        </el-form-item>
        <!--课程等级-->
        <el-form-item label="课程等级" label-width="100">
          <el-select
              v-model="itemInfo.courseId"
              placeholder="Select"
              style="width: 240px"
          >
            <el-option
                v-for="item in dictStatus2"
                :key="item.id"
                :label="item.name"
                :value="item.code"
            />
          </el-select>
        </el-form-item>
        <!--身份证号-->
        <el-form-item label="身份证号" label-width="100">
          <el-input v-model="itemInfo.sdCard" maxlength="18" disabled minlength="15" />
        </el-form-item>
        <!--文化程度-->
        <el-form-item label="文化程度" label-width="100">
          <el-select
              v-model="itemInfo.culture"
              placeholder="Select"
              style="width: 240px"
              disabled
          >
            <el-option
                v-for="item in dictStatus6"
                :key="item.id"
                :label="item.name"
                :value="item.code"
            />
          </el-select>
        </el-form-item>
        <!--报考专业-->
        <el-form-item label="报考专业" label-width="100">
          <el-input v-model="itemInfo.major" disabled />
        </el-form-item>
        <!--毕业证书-->
        <el-form-item label="毕业证书" label-width="100">
            <img  :src="visitPath+itemInfo.certificateImg" class="avatar" />
        </el-form-item>
        <!--身份证正面-->
        <el-form-item label="身份证正面" label-width="100">
            <img  :src="visitPath+itemInfo.beforeIdentityImg" class="avatar" />
        </el-form-item>
        <!--审核状态-->
        <el-form-item label="审核状态" label-width="100">
          <el-select
              v-model="itemInfo.status"
              placeholder="Select"
              style="width: 240px"
          >
            <el-option
                v-for="item in dictStatus3"
                :key="item.id"
                :label="item.name"
                :value="item.code"
            />
          </el-select>
        </el-form-item>
      </div>
      <div  class="justify-center w-full d-column p-10" style="width: 310px">
        <!--手机号-->
        <el-form-item label="手机号" label-width="100">
          <el-input v-model="itemInfo.phone" maxlength="11" minlength="11" disabled/>
        </el-form-item>
        <!--性别-->
        <el-form-item label="性别" label-width="100">
          <el-select
              v-model="itemInfo.sex"
              placeholder="Select"
              style="width: 240px"
              disabled
          >
            <el-option
                v-for="item in dictStatus7"
                :key="item.id"
                :label="item.name"
                :value="item.code"
            />
          </el-select>
        </el-form-item>
        <!--邮箱-->
        <el-form-item label="邮箱" label-width="100" >
          <el-input v-model="itemInfo.email" disabled  type="text"/>
        </el-form-item>
        <!--毕业院校-->
        <el-form-item label="毕业院校" label-width="100">
          <el-input v-model="itemInfo.school" disabled />
        </el-form-item>

        <!--备注信息-->
        <el-form-item label="备注信息" label-width="100">
          <el-input v-model="itemInfo.remark" disabled/>
        </el-form-item>
        <!--用户证件照-->
        <el-form-item label="证件照" label-width="100">
            <img  :src="visitPath+itemInfo.blueImg" class="avatar" />
        </el-form-item>
        <!--身份证反面-->
        <el-form-item label="身份证反面" label-width="100">
            <img  :src="visitPath+itemInfo.behindIdentityImg" class="avatar" />
        </el-form-item>
        <!--驳回原因-->
        <el-form-item :label="itemInfo.status==='3'?'驳回原因':'审核备注'" label-width="100">
          <el-select
              v-if="itemInfo.status==='3'"
              v-model="itemInfo.checkRemake"
              placeholder="请选择驳回原因"
              style="width: 240px"
          >
            <el-option
                v-for="item in dictStatus4"
                :key="item.id"
                :label="item.name"
                :value="item.code"
            />
          </el-select>
          <el-input v-else v-model="itemInfo.checkRemake"  />
        </el-form-item>
      </div>
      <div style="width: 30px;"></div>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="show = false">取消</el-button>
        <el-button type="primary" @click="onSubmit()">
          提交
        </el-button>
      </div>
    </template>
  </el-dialog>
</template>




<script setup lang="ts">
import {uploadPath, visitPath} from "@/api/edu/fileApi";
import {onMounted, ref, watch} from "vue";
import {postQueryStatus} from "@/api/edu/dictApi";
import {postUpdateEntry} from "@/api/edu/entryApi";
import {msg} from "@/config/Tool";

let props = defineProps<{ itemInfo: any }>();//接收外部传过来的值（接收）
const Emit = defineEmits(["receiveEntry"]);//定义外部的函数 向外界传值（确定按钮）
const dictStatus2=ref([]);//课程等级
const dictStatus3=ref([]);//审核状态
const dictStatus4=ref([]);//驳回原因
const dictStatus6=ref([]);//文化程度
const dictStatus7=ref([]);//性别
const show = ref(true)


/**---------------------------------------------------*/
watch(show,(newValue)=>{
  if (!newValue){
    Emit('receiveEntry',false)
  }
})

onMounted(()=>{
  postQueryStatusFun()
})


/**
 * 查询字典状态
 */
function postQueryStatusFun(){
  postQueryStatus({"type":2}).then(res=>{
    if (res.code===200){
      dictStatus2.value=res.data;
    }
  })
  postQueryStatus({"type":3}).then(res=>{
    if (res.code===200){
      dictStatus3.value=res.data;
    }
  })
  postQueryStatus({"type":4}).then(res=>{
    if (res.code===200){
      dictStatus4.value=res.data;
    }
  })
  postQueryStatus({"type":6}).then(res=>{
    if (res.code===200){
      dictStatus6.value=res.data;
    }
  })
  postQueryStatus({"type":7}).then(res=>{
    if (res.code===200){
      dictStatus7.value=res.data;
    }
  })

}


/**
 * 提交数据
 */
function onSubmit(){
  postUpdateEntry(props.itemInfo).then(res=>{
    msg(res,"提交成功");
    if (res.code===200){
      show.value=false;
    }
  })
}
</script>
